package cm.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "XxlJobInfoUpdateDTO", description = "")
public class XxlJobInfoUpdateDTO implements Serializable {
    private static final long serialVersionUID = -94468344916228171L;

    @ApiModelProperty(value = "${column.comment}")
    private Integer id;

    @NotNull(message = "请填写执行器主键ID")
    @ApiModelProperty(value = "执行器主键ID", example = "1")
    private Integer jobGroup;

    @NotBlank(message = "请填写${column.comment}")
    @Length(min = 1, max = 48, message = "${column.comment}须48字以内")
    @ApiModelProperty(value = "${column.comment}", example = "${column.comment}1")
    private String jobDesc;

	@ApiModelProperty(value = "${column.comment}", example = "?")
    private LocalDateTime addTime;

    @NotBlank(message = "请填写作者")
    @Length(min = 1, max = 48, message = "作者须48字以内")
    @ApiModelProperty(value = "作者", example = "作者1")
    private String author;

    @NotBlank(message = "请填写报警邮件")
    @Length(min = 1, max = 48, message = "报警邮件须48字以内")
    @ApiModelProperty(value = "报警邮件", example = "报警邮件1")
    private String alarmEmail;

    @NotBlank(message = "请填写调度类型")
    @Length(min = 1, max = 48, message = "调度类型须48字以内")
    @ApiModelProperty(value = "调度类型", example = "调度类型1")
    private String scheduleType;

    @NotBlank(message = "请填写调度配置，值含义取决于调度类型")
    @Length(min = 1, max = 48, message = "调度配置，值含义取决于调度类型须48字以内")
    @ApiModelProperty(value = "调度配置，值含义取决于调度类型", example = "调度配置，值含义取决于调度类型1")
    private String scheduleConf;

    @NotBlank(message = "请填写调度过期策略")
    @Length(min = 1, max = 48, message = "调度过期策略须48字以内")
    @ApiModelProperty(value = "调度过期策略", example = "调度过期策略1")
    private String misfireStrategy;

    @NotBlank(message = "请填写执行器路由策略")
    @Length(min = 1, max = 48, message = "执行器路由策略须48字以内")
    @ApiModelProperty(value = "执行器路由策略", example = "执行器路由策略1")
    private String executorRouteStrategy;

    @NotBlank(message = "请填写执行器任务handler")
    @Length(min = 1, max = 48, message = "执行器任务handler须48字以内")
    @ApiModelProperty(value = "执行器任务handler", example = "执行器任务handler1")
    private String executorHandler;

    @NotBlank(message = "请填写执行器任务参数")
    @Length(min = 1, max = 48, message = "执行器任务参数须48字以内")
    @ApiModelProperty(value = "执行器任务参数", example = "执行器任务参数1")
    private String executorParam;

    @NotBlank(message = "请填写阻塞处理策略")
    @Length(min = 1, max = 48, message = "阻塞处理策略须48字以内")
    @ApiModelProperty(value = "阻塞处理策略", example = "阻塞处理策略1")
    private String executorBlockStrategy;

    @NotNull(message = "请填写任务执行超时时间，单位秒")
    @ApiModelProperty(value = "任务执行超时时间，单位秒", example = "1")
    private Integer executorTimeout;

    @NotNull(message = "请填写失败重试次数")
    @ApiModelProperty(value = "失败重试次数", example = "1")
    private Integer executorFailRetryCount;

    @NotBlank(message = "请填写GLUE类型")
    @Length(min = 1, max = 48, message = "GLUE类型须48字以内")
    @ApiModelProperty(value = "GLUE类型", example = "GLUE类型1")
    private String glueType;

    @NotBlank(message = "请填写GLUE源代码")
    @Length(min = 1, max = 48, message = "GLUE源代码须48字以内")
    @ApiModelProperty(value = "GLUE源代码", example = "GLUE源代码1")
    private String glueSource;

    @NotBlank(message = "请填写GLUE备注")
    @Length(min = 1, max = 48, message = "GLUE备注须48字以内")
    @ApiModelProperty(value = "GLUE备注", example = "GLUE备注1")
    private String glueRemark;

	@ApiModelProperty(value = "GLUE更新时间", example = "?")
    private LocalDateTime glueUpdatetime;

    @NotBlank(message = "请填写子任务ID，多个逗号分隔")
    @Length(min = 1, max = 48, message = "子任务ID，多个逗号分隔须48字以内")
    @ApiModelProperty(value = "子任务ID，多个逗号分隔", example = "子任务ID，多个逗号分隔1")
    private String childJobid;

    @NotNull(message = "请填写调度状态：0-停止，1-运行")
    @ApiModelProperty(value = "调度状态：0-停止，1-运行", example = "1")
    private Integer triggerStatus;

    @NotNull(message = "请填写上次调度时间")
    @ApiModelProperty(value = "上次调度时间", example = "1")
    private Long triggerLastTime;

    @NotNull(message = "请填写下次调度时间")
    @ApiModelProperty(value = "下次调度时间", example = "1")
    private Long triggerNextTime;
//
//    @ApiModelProperty(value = "登录用户", hidden = true)
//    private LoginUser loginUser;
}
